#include "Widget.h"

#include <QGraphicsBlurEffect>
#include <QPaintEvent>
#include <QPainter>
#include <QPixmap>

Widget::Widget(QWidget *parent)
	: QWidget(parent)
	, x_pNetEasyBanner(nullptr)
{
    ui.setupUi(this);

    x_pNetEasyBanner = new QNetEasyBanner(ui.frame);

    x_pNetEasyBanner->addImage(":/image/1");
    x_pNetEasyBanner->addImage(":/image/2");
    x_pNetEasyBanner->addImage(":/image/3");
    x_pNetEasyBanner->addImage(":/image/4");
    x_pNetEasyBanner->addImage(":/image/5");
    x_pNetEasyBanner->addImage(":/image/6");
    x_pNetEasyBanner->addImage(":/image/7");
    x_pNetEasyBanner->addImage(":/image/8");

    connect(ui.btn_left, SIGNAL(clicked()), x_pNetEasyBanner, SLOT(onPrev()));
    connect(ui.btn_right, SIGNAL(clicked()), x_pNetEasyBanner, SLOT(onNext()));
    connect(ui.btn_jump, SIGNAL(clicked()), this, SLOT(slot_jump()));
}

Widget::~Widget() {}

void Widget::slot_jump()
{
    x_pNetEasyBanner->onJump(ui.lineEdit->text().toInt());
}
